<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:nya="http://desu.nya.anime">
    <h:head>
        <title>Facelet Title</title>
        <h:outputStylesheet name="css/jsfcrud.css"/>
        <link rel="stylesheet" type="text/css" href="../resources/css/templateStyle.css"/>
    </h:head>
    <h:body>
 
        
<ui:composition template="/Templates/mainTemplate.xhtml">
    <ui:define name="content">
        <h:form  enctype="multipart/form-data" id="form">
            <h:panelGrid columns="2">
                <h:panelGrid columns="2" style="top: 0" id="filter">
                    <h:outputText value="#{msg.href}: "/>
                    <h:inputText value="#{crBean.newHref}" styleClass="filterSI"/>
                    
                    <p:commandButton actionListener="#{crBean.worldArtParse()}" value="Parsing" update=":form" onclick="dlg.show()"/>
                    <p:commandButton actionListener="#{crBean.hrefNextSearch()}" value="Next parse" update=":form" onclick="dlg.show()"/>
                    
                    <h:outputText value="#{msg.name} "/>
                    <h:inputText value="#{crBean.newName}" styleClass="filterSI"/>
                    
                    <h:outputText value="#{msg.studio}: "/>
                    <h:selectOneMenu value="#{crBean.newStudioId}" styleClass="filterSI">
                        <f:selectItems value="#{fltrBean.studioSI}" binding="#{crBean.som}" />
                    </h:selectOneMenu>
                    
                    <h:outputText value="#{msg.typeEd}: "/>
                    <h:selectOneMenu value="#{crBean.newTypeId}" styleClass="filterSI">
                        <f:selectItems value="#{fltrBean.typeSI}"/>
                    </h:selectOneMenu>
                    
                    <h:outputText value="#{msg.genre}: "/>
                    <p:scrollPanel mode="native" style="height: 130px" styleClass="filterSI">
                        <p:selectManyCheckbox  value="#{crBean.newGenre}"  layout="pageDirection" >
                            <f:selectItems value="#{fltrBean.genreSI}"/>
                        </p:selectManyCheckbox>
                    </p:scrollPanel>
                    
                    <h:outputText value="#{msg.chapter}: "/>
                    <h:inputText value="#{crBean.newChapt}" styleClass="filterSI"/>
                    
                    <h:outputText value="#{msg.countSer}: "/>
                    <h:inputText value="#{crBean.newCountOfSer}" styleClass="filterSI"/>
                    
                    <h:outputText value="#{msg.duration}: "/>
                    <h:inputText value="#{crBean.newDuration}" styleClass="filterSI"/>
                    
                    <h:outputText value="#{msg.director}: "/>
                    <h:inputText value="#{crBean.newDirector}" styleClass="filterSI"/>
                    
                    <h:outputText value="#{msg.cover}: "/>
                    <h:inputText value="#{crBean.newCoverId}" styleClass="filterSI"/>
                    
                    
                    
                    <h:outputText value="#{msg.translOp}: "/>
                    <p:calendar value="#{crBean.dateOp}" styleClass="filterSI" showOn="button"/>
                    
                    <h:outputText value="#{msg.translEnd}: "/>
                    <p:calendar value="#{crBean.dateEnd}" styleClass="filterSI" showOn="button"/>
                    
                    </h:panelGrid>
                <h:panelGrid columns="2" id="imagePanel">
                    <p:graphicImage value="#{crBean.fileImg}" rendered="#{crBean.fileImg!=null}" />
                    <h:panelGrid title="#{crBean.anime.name}" rendered="#{crBean.anime!=null}">
                        <nya:animeDisplay anime="#{crBean.anime}" coverParam="coverId" 
                                      genreList="#{crBean.genreList}" update=":form" rateValue="0" 
                                      onRateIconClick="voteDisplay.show()" readonly="#{sessBean.auth}" rendered="true">
                        </nya:animeDisplay>
                    </h:panelGrid>
                </h:panelGrid>
                </h:panelGrid>
            <p:commandButton actionListener="#{crBean.animeAdd()}" value="#{msg.animeAdd}" update=":form"/>
            <p:commandButton actionListener="#{crBean.animeSave()}" value="Save" update=":form" disabled="#{crBean.anime==null}"/>
            
            <p:commandButton actionListener="#{crBean.test()}" value="Test" update=":form" />
            <br/>
            
            <p:dialog widgetVar="dlg">
                <h:outputText value="#{crBean.createdStudioName}"/>
            </p:dialog>
            <p:growl/>
            </h:form>

    </ui:define>
    
    </ui:composition>
    </h:body>
</html>

